package com.bupt.utils;

import com.bupt.annotation.MParam;

public class PassWordUtils {

    // 随机加密字符串
    private static final String DEFAULT_SALT = "sagdksagvcxfshlfgsdffkjasfjhk";

    // 获取数据库里买的密码
    public static String getDbPassWord(@MParam("输入的明文密码") String fromFormPass,
                                       @MParam("密码盐") String salt) {
        String tempPass = DEFAULT_SALT.charAt(6) + fromFormPass + DEFAULT_SALT.charAt(6) + DEFAULT_SALT.charAt(2) +
                salt + DEFAULT_SALT.charAt(3);
        return LocalMD5Utils.md5DigestHexString(tempPass);
    }
}
